{% extends "barebase.html" %}

{% block head %}
	{% if FConnectLoader %}
		{{FConnectLoader}}
		
		<!-- My own Friend Connect related items -->
		<script type="text/javascript">
		fcUser = ""; // "fc" prefix is for "-F-riend -C-onnect"
		
		// called after API becomes available
		function initAllData() {
			// first detect who is viewing the page
			var req = opensocial.newDataRequest();
			req.add(req.newFetchPersonRequest('VIEWER'), 'viewer');
			req.send(onLoadCallback);
		}
		
		// called after [user] data is loaded
		function onLoadCallback(data) {         
			if(data.get('viewer').getData()) {
				var viewer = data.get('viewer').getData();
				fcUser = viewer.getDisplayName();
			} else {
				fcUser = "";
			}
			initPage(); // each experiment page that use Friend Connect JavaScript API must implement this
		}
		</script>
	{% endif %}
{% endblock %}

{% block maincontent %}
		<table width=100% height=100%>
		<tr><td style="height: 30px; border-bottom: 1px solid rgb(201, 215, 241);">
			  <a href="/">Home</a>
			| <a href="/about{{exp_url_return}}">About</a>
		{% if exp_url %}
			| <a href="{{exp_url}}">Current Experiment</a>
		{% endif %}
		</td></tr>
		<tr><td style="height: 20px; border-bottom: 1px solid rgb(201, 215, 241);">
		<i>Feel free to sign-in at any experiment on this site. This website does not store any personal information, except where stated explicitly, as provided by the <a href="/privacy{{exp_url_return}}">Privacy Notice</a></i>
		</td></tr>
		<tr><td style="padding-top: 10px">
	{% block content %}{% endblock %}
		</td></tr>
		
		<tr><td id="footer">
			<a href="/privacy{{exp_url_return}}">Privacy Notice</a>
			| <a href="/terms{{exp_url_return}}">Terms of Use</a>
		</td></tr>
		</table>
{% endblock %}
